<template>
  <template v-for="(item, index) in dataList" :key="index">
    <VideoItem :data="item" :layout-type="1" :margin-top="20"></VideoItem>
  </template>
</template>

<script setup lang="ts">
import type { VideoInfo } from '@/services/api/home'
import { getRecommendVideoHttpRequest } from '@/services/api/video'
import { inject, ref } from 'vue'
import { useRoute } from 'vue-router'

const route = useRoute()

const dataList = ref<VideoInfo[]>([])

const videoInfoDetail: any = inject('videoInfo')

const loadDataList = async () => {
  const res = await getRecommendVideoHttpRequest(
    videoInfoDetail.value.videoInfo.videoName,
    videoInfoDetail.value.videoInfo.videoId
  )
  dataList.value = res.data
}
loadDataList()
</script>

<style lang="less" scoped>
.recomend-panel {
}
</style>
